package com.telecom.taglibs;

import java.io.IOException;
import java.sql.Connection;

import javax.servlet.jsp.JspException;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.BodyTagSupport;

import com.telecom.cms.util.Constant;
import com.telecom.cms.dao.GetConnect;
import com.telecom.cms.dbmodel.DAO_BAK.SEG_BIZ_ATOM_DEF_NEWDAO;
import com.telecom.cms.dbmodel.DTO.SEG_BIZ_ATOM_DEF_NEWDTO;
import com.telecom.tree.TreeUtil;

public class FolderTreeTag extends BodyTagSupport {

	private int property;

	public int getProperty() {
		return this.property;
	}

	public void setProperty(int property) {
		this.property = property;
	}

	@Override
	public int doAfterBody() throws JspException {
		// TODO Auto-generated method stub

		BodyContent body = this.getBodyContent();
		StringBuffer st = new StringBuffer();
		st.append("<script type=\"text/javascript\">\n");

		st.append(TreeUtil.createTreeInfo(TreeUtil
				.retrieveNodeInfos(Constant.SEG_USER_FOLDER_DEF), "TREEROOT"));

		st.append("</script>\n");

		try {
			body.getEnclosingWriter().println(st.toString());
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return EVAL_PAGE;

	}

	

}
